package com.java80.springmall.cloud.order.provider.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.java80.springmall.cloud.order.provider.entity.Orders;
import com.java80.springmall.cloud.order.provider.repository.OrderRepository;
import com.java80.springmall.cloud.order.provider.service.OrderService;

@RestController
@RequestMapping("/order")
public class OrderController {
	@Autowired
	private OrderService osvc;
	
	@PostMapping("/createOrder")
	public boolean createOrder(@RequestBody Orders order){
		Orders save = osvc.save(order);
		return save!=null;
	}
}
